module HplProducts.HephaestusTypes where

import FeatureModel.Types
import HplAssets.Hephaestus.Types
 
data SPLModel = SPLModel{splHpl :: HephaestusModel}
 
data InstanceModel = InstanceModel{featureConfiguration ::
                                   FeatureConfiguration,
                                   hpl :: HephaestusModel}
                                   
data TransformationModel = UndefinedTransformation
                         | HephaestusTransformation HephaestusTransformation deriving (Show)  
                                        
                                        
-- | The model used to relate feature expressions 
--   to transformations. The configuration knowledge 
--   guides the 'building' process of SPL instances.
type ConfigurationKnowledge = [ConfigurationItem]

data ConfigurationItem =  ConfigurationItem {
                       expression :: FeatureExpression,                -- ^ if expression holds True for a product configuration...
                       transformations :: [TransformationModel]        -- ^ the list of transformations would be applied.
                       } | 
                       ConstrainedConfigurationItem { 
                          expression :: FeatureExpression,                -- ^ if expression holds True for a product configuration...
                          transformations :: [TransformationModel],       -- ^ the list of transformations would be applied.
                          required :: FeatureExpression,     -- ^ required expression for this configuration 
                          provided :: FeatureExpression      -- ^ provided expression for this configuration
                       } deriving (Show)

constrained :: ConfigurationItem -> Bool
constrained (ConstrainedConfigurationItem _ _ _ _) = True
constrained _ = False


                         